

#pragma once

#include "DBManager/IRepository/Result/Random/ICROSS_PSDRepository.h"
#include "DBManager/Repository/HDF5/Base/ResultRepositoryBase.h"

template <>
inline HighFive::DataType HighFive::create_datatype<SG::DataStructure::Post::CROSS_PSDData> ()
{
    HighFive::CompoundType compoundType = { { "RCROSS", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "RTYPE1", HighFive::create_datatype<char[4]> (), 1, true },
                                            { "ID1", HighFive::create_datatype<SG::DataStructure::Common::Id> () },
                                            { "COMP1", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "RTYPE2", HighFive::create_datatype<char[4]> (), 1, true },
                                            { "ID2", HighFive::create_datatype<SG::DataStructure::Common::Id> () },
                                            { "COMP2", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "RCPSDF", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "ICPSDF", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "CURID", HighFive::create_datatype<SG::DataStructure::Common::Id> () },
                                            { "DOMAIN_ID", HighFive::create_datatype<SG::DataStructure::Common::Id> () } };
    return compoundType;
}

SG_DBMANAGER_HDF5_NAMESPACE_OPEN

class CROSS_PSDRepository : public ICROSS_PSDRepository,
                                       public SG::DBManager::HDF5::ResultRepositoryBase<SG::DataStructure::Post::CROSS_PSDData>
{
  public:
    explicit CROSS_PSDRepository (HDF5Database& database);

    void InitialDatasetInfo () override;
};
SG_DBMANAGER_HDF5_NAMESPACE_CLOSE
